package cn.edu.xmu.oomall.payment.mapper.generator;

import cn.edu.xmu.oomall.payment.mapper.generator.po.ChannelPo;
import cn.edu.xmu.oomall.payment.mapper.generator.po.ChannelPoExample;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectKey;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.type.JdbcType;

public interface ChannelPoMapper {
    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table payment_channel
     *
     * @mbg.generated
     */
    @Delete({
        "delete from payment_channel",
        "where `id` = #{id,jdbcType=BIGINT}"
    })
    int deleteByPrimaryKey(Long id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table payment_channel
     *
     * @mbg.generated
     */
    @Insert({
        "insert into payment_channel (`sp_appid`, `name`, ",
        "`sp_mchid`, `begin_time`, ",
        "`end_time`, `status`, ",
        "`bean_name`, `creator_id`, ",
        "`creator_name`, `modifier_id`, ",
        "`modifier_name`, `gmt_create`, ",
        "`gmt_modified`)",
        "values (#{spAppid,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, ",
        "#{spMchid,jdbcType=VARCHAR}, #{beginTime,jdbcType=TIMESTAMP}, ",
        "#{endTime,jdbcType=TIMESTAMP}, #{status,jdbcType=TINYINT}, ",
        "#{beanName,jdbcType=VARCHAR}, #{creatorId,jdbcType=BIGINT}, ",
        "#{creatorName,jdbcType=VARCHAR}, #{modifierId,jdbcType=BIGINT}, ",
        "#{modifierName,jdbcType=VARCHAR}, #{gmtCreate,jdbcType=TIMESTAMP}, ",
        "#{gmtModified,jdbcType=TIMESTAMP})"
    })
    @SelectKey(statement="SELECT LAST_INSERT_ID()", keyProperty="id", before=false, resultType=Long.class)
    int insert(ChannelPo row);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table payment_channel
     *
     * @mbg.generated
     */
    @InsertProvider(type=ChannelPoSqlProvider.class, method="insertSelective")
    @SelectKey(statement="SELECT LAST_INSERT_ID()", keyProperty="id", before=false, resultType=Long.class)
    int insertSelective(ChannelPo row);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table payment_channel
     *
     * @mbg.generated
     */
    @SelectProvider(type=ChannelPoSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
        @Result(column="sp_appid", property="spAppid", jdbcType=JdbcType.VARCHAR),
        @Result(column="name", property="name", jdbcType=JdbcType.VARCHAR),
        @Result(column="sp_mchid", property="spMchid", jdbcType=JdbcType.VARCHAR),
        @Result(column="begin_time", property="beginTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="end_time", property="endTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="status", property="status", jdbcType=JdbcType.TINYINT),
        @Result(column="bean_name", property="beanName", jdbcType=JdbcType.VARCHAR),
        @Result(column="creator_id", property="creatorId", jdbcType=JdbcType.BIGINT),
        @Result(column="creator_name", property="creatorName", jdbcType=JdbcType.VARCHAR),
        @Result(column="modifier_id", property="modifierId", jdbcType=JdbcType.BIGINT),
        @Result(column="modifier_name", property="modifierName", jdbcType=JdbcType.VARCHAR),
        @Result(column="gmt_create", property="gmtCreate", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="gmt_modified", property="gmtModified", jdbcType=JdbcType.TIMESTAMP)
    })
    List<ChannelPo> selectByExample(ChannelPoExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table payment_channel
     *
     * @mbg.generated
     */
    @Select({
        "select",
        "`id`, `sp_appid`, `name`, `sp_mchid`, `begin_time`, `end_time`, `status`, `bean_name`, ",
        "`creator_id`, `creator_name`, `modifier_id`, `modifier_name`, `gmt_create`, ",
        "`gmt_modified`",
        "from payment_channel",
        "where `id` = #{id,jdbcType=BIGINT}"
    })
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
        @Result(column="sp_appid", property="spAppid", jdbcType=JdbcType.VARCHAR),
        @Result(column="name", property="name", jdbcType=JdbcType.VARCHAR),
        @Result(column="sp_mchid", property="spMchid", jdbcType=JdbcType.VARCHAR),
        @Result(column="begin_time", property="beginTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="end_time", property="endTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="status", property="status", jdbcType=JdbcType.TINYINT),
        @Result(column="bean_name", property="beanName", jdbcType=JdbcType.VARCHAR),
        @Result(column="creator_id", property="creatorId", jdbcType=JdbcType.BIGINT),
        @Result(column="creator_name", property="creatorName", jdbcType=JdbcType.VARCHAR),
        @Result(column="modifier_id", property="modifierId", jdbcType=JdbcType.BIGINT),
        @Result(column="modifier_name", property="modifierName", jdbcType=JdbcType.VARCHAR),
        @Result(column="gmt_create", property="gmtCreate", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="gmt_modified", property="gmtModified", jdbcType=JdbcType.TIMESTAMP)
    })
    ChannelPo selectByPrimaryKey(Long id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table payment_channel
     *
     * @mbg.generated
     */
    @UpdateProvider(type=ChannelPoSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(ChannelPo row);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table payment_channel
     *
     * @mbg.generated
     */
    @Update({
        "update payment_channel",
        "set `sp_appid` = #{spAppid,jdbcType=VARCHAR},",
          "`name` = #{name,jdbcType=VARCHAR},",
          "`sp_mchid` = #{spMchid,jdbcType=VARCHAR},",
          "`begin_time` = #{beginTime,jdbcType=TIMESTAMP},",
          "`end_time` = #{endTime,jdbcType=TIMESTAMP},",
          "`status` = #{status,jdbcType=TINYINT},",
          "`bean_name` = #{beanName,jdbcType=VARCHAR},",
          "`creator_id` = #{creatorId,jdbcType=BIGINT},",
          "`creator_name` = #{creatorName,jdbcType=VARCHAR},",
          "`modifier_id` = #{modifierId,jdbcType=BIGINT},",
          "`modifier_name` = #{modifierName,jdbcType=VARCHAR},",
          "`gmt_create` = #{gmtCreate,jdbcType=TIMESTAMP},",
          "`gmt_modified` = #{gmtModified,jdbcType=TIMESTAMP}",
        "where `id` = #{id,jdbcType=BIGINT}"
    })
    int updateByPrimaryKey(ChannelPo row);
}